home *** CD-ROM | disk | FTP | other *** search
/ Essentials of Interactive Physiology / Essentials of Interactive Physiology.iso / pc / files / evaluation / evaluation.dcr / 00024.ls < prev    next >
Encoding:
Text File  |  2002-04-02  |  1.3 KB  |  43 lines

  1. on createChapterQuestionFields
  2.   goFileMan = new(script("FileManParent"))
  3.   vsFileName = the pathname & "quizData"
  4.   vsQuestions = mReadStringFromFile(goFileMan, vsFileName)
  5.   vsOld = the itemDelimiter
  6.   the itemDelimiter = TAB
  7.   vsLine = line 1 of vsQuestions
  8.   vsChapter = item 1 of vsLine
  9.   delete item 1 of vsLine
  10.   delete line 1 of vsQuestions
  11.   viNumAnswers = the number of items in vsLine
  12.   repeat with i = 3 to viNumAnswers
  13.     if item i of vsLine = EMPTY then
  14.       delete item i of vsLine
  15.     end if
  16.   end repeat
  17.   repeat while vsQuestions <> EMPTY
  18.     vsOneChaptersQuestions = EMPTY
  19.     vsPrevChapter = vsChapter
  20.     viField = new(#field, castLib("questions"))
  21.     repeat while vsChapter = vsPrevChapter
  22.       vsOneChaptersQuestions = vsOneChaptersQuestions & RETURN & vsLine
  23.       vsLine = line 1 of vsQuestions
  24.       vsChapter = item 1 of vsLine
  25.       delete item 1 of vsLine
  26.       delete line 1 of vsQuestions
  27.       viNumAnswers = the number of items in vsLine
  28.       repeat with i = 3 to viNumAnswers
  29.         if item i of vsLine = EMPTY then
  30.           delete item i of vsLine
  31.         end if
  32.       end repeat
  33.     end repeat
  34.     put vsChapter
  35.     member(viField).name = IntegerToString(integer(vsPrevChapter), 2)
  36.     delete line 1 of vsOneChaptersQuestions
  37.     member(viField).text = vsOneChaptersQuestions
  38.   end repeat
  39.   beep()
  40.   beep()
  41.   beep()
  42. end
  43.